home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-15 | 7.4 KB | 278 lines | [TEXT/MPS ] |
- //
- // myActionAtoms.r
- //
- // Purpose : Demonstrate use of the three types of action atoms.
- //
- // There are four selectable packages in Custom Install. Each
- // package calls one of the three formats of action atoms. Each
- // action atom will be called before install, and will not be
- // called at all when performing a custom remove.
- //
- // A dialog is provided that will allow the user to choose which
- // value should be returned from the current action atom.
- //
- // The third Custom Install option includes Installer Debugger
- // example code within the action atom to display status and
- // progress information to the Installer Debugger during execution
- // of the action atom. To observe this feature, drag drop a copy
- // of the debugger version of the installer script onto a copy of
- // the installer application that contains the Wasabi Installer
- // Debugger.
- //
- // The fourth option calls an action atom that displays progress
- // in the Installer dialog progress bar while the action atom is
- // running.
- //
- // NOTE: A file atom has been included with each action
- // atom in the three packages. Action atoms can, however,
- // be included in packages by themselves.
- //
- //
- // mark young • 08/25/94
- //
- // Copyright 1993-1994, Apple Computer, Inc., All Rights Reserved
- //
-
- #include "InstallerTypes.r"
-
- // custom install framework always uses ID of 766
- resource 'infr' (766) {
- format0 {{
- pickFirst, { 700 }, // adds TeachText to custom install options
- }}
- };
-
- // • rules
-
- // rule that adds package with the subpackages
- resource 'inrl' (700) {
- format0 {{
- AddCustomItems{{ 100,200,300,400 }},
- }}
- };
-
-
- // • packages
-
- resource 'inpk' (100) {
- format0 {
- showsOnCustom,
- removable,
- dontForceRestart,
- 0,
- 0,
- "Run action atom format 0 - with TeachText",
- {
- 'infa', 1000;
- 'inaa', 9000;
- },
- }
- };
-
- resource 'inpk' (200) {
- format0 {
- showsOnCustom,
- removable,
- dontForceRestart,
- 0,
- 0,
- "Run action atom format 1 - with TeachText",
- {
- 'infa', 1000;
- 'inaa', 9001;
- },
- }
- };
-
- resource 'inpk' (300) {
- format0 {
- showsOnCustom,
- removable,
- dontForceRestart,
- 0,
- 0,
- "Run action atom format 2 - with TeachText",
- {
- 'infa', 1000;
- 'inaa', 9002;
- },
- }
- };
-
- resource 'inpk' (400) {
- format0 {
- showsOnCustom,
- removable,
- dontForceRestart,
- 0,
- 0,
- "Progress Bar action atom ( format2 ) - with TeachText",
- {
- 'infa', 1000;
- 'inaa', 9003;
- },
- }
- };
-
-
-
- // • file atoms
-
- // file atom for TeachText ( same file atom used for all packages )
- resource 'infa' (1000) {
- format1 {
- deleteWhenRemoving, // Delete existing file on remove
- deleteWhenInstalling, // Delete existing file on install
- copy, // Copy on Install
- dontIgnoreLockedFile, // Respect file locking
- dontSetFileLocked, // Don't lock installed file
- useSrcCrDateToCompare, // Use date for comparisons
- srcNeedExist, // Never create new file ( update only )
- rsrcForkInRsrcFork, // Put resources in resource fork
- leaveAloneIfNewer, // Do not update a newer file
- updateExisting, // Update an existing file
- copyIfNewOrUpdate, // Copy whether it preexists or not
- rsrcFork, // Copy or Remove resource fork
- dataFork, // Copy or Remove data fork
- 0, // File size
- 0x0, // File Finder attributes
- 11001, // Target spec ( 'intf' )
- {
- 11000, // Source spec ( 'infs' )
- 0, // Data fork size
- 0 // Resource fork size
- },
- 0, // Source version number in BCD format
- 0, // Version compare resource ID
- 0, // Atom extender resource ID
- "TeachText" // Atom description
- }
- };
-
-
- // • file specs
-
- // target file spec for teach text application
- resource 'intf' (11001) {
- format1 {
- noSearchForFile, // use default search path
-
- TypeCrMustMatch, // If this is set to TypeCrMustMatch
- // then a file with a different type
- // and creator will not be replaced.
- // If this is set to TypeCrNeedNotMatch
- // then type and creator of an existing
- // target file are ignored.
-
- // The Type and Creator fields will be used to set the
- // file's Type and Creator when a new file is created.
- 'APPL', // TYPE for new file
- 'ttxt', // CREATOR for new file
-
- 0, // finder attribute flags
- // filled by ScriptCheck is value is 0
-
- 1, // creation date for new file
- 1, // modification date for new file
- // NOTE: DATE values are filled
- // by ScriptCheck if the value is 1
-
- 0, // search proc ID ( 'insp' ), none used
-
- ":ActionAtom Example:TeachText" // path to target file
- }
- };
-
- // source file spec for teach text application
- resource 'infs' (11000) {
- 'APPL', // TYPE for source file
- 'ttxt', // CREATOR for source file
- 0x1, // creation DATE for source file
- noSearchForFile, // IGNORED in Installer 4.0.x
- TypeCrMustMatch, // TYPE, CREATOR must match file on install disk
- "Disk 1:TeachText" // PATH to source file
- };
-
-
- // • action atoms
-
- // format0 action atom
- include "myActionAtom_0.rsrc";
-
- // format1 action atom
- include "myActionAtom_1.rsrc";
-
- // format2 action atom
- include "myActionAtom_2.rsrc";
-
- // format2 action atom
- include "ProgressAtom.rsrc";
-
- resource 'inaa' ( 9000 ) {
- format0{
- actBefore, // when to run action atom
- dontActOnRemove, // run action atom on removal
- actOnInstall, // run action atom on install
- 'infn', // resource type of code resource
- 9000, // resource ID of code resource
- 0, // refcon ID
- "action atom format 0" // description of atom
- }
- };
-
- resource 'inaa' ( 9001 ) {
- format1{
- suspendBusyCursors, // how to handle cursor during atom
- actBefore, // when to run action atom
- dontActOnRemove, // run action atom on removal
- actOnInstall, // run action atom on install
- 'infn', // resource type of code resource
- 9001, // resource ID of code resource
- 1, // refcon ID
- "action atom format 1" // description of atom
- }
- };
-
- resource 'inaa' ( 9002 ) {
- format2{
- suspendBusyCursors, // how to handle cursor during atom
- actBefore, // when to run action atom
- dontActOnRemove, // run action atom on removal
- actOnInstall, // run action atom on install
- 'infn', // resource type of code resource
- 9002, // resource ID of code resource
- 2, // refcon ID
-
- // NOTE: Enter zero for this value to use the installer's heap,
- // or enter size in bytes to have this action atom use it's own heap.
- // All earlier action atom formats use the installer's heap.
- // IMPORTANT: enter zero for this field unless you have a specific
- // reason for your action atom to use memory from it's own heap.
- 0, // requested memory in bytes
-
-
- "action atom format 2" // description of atom
- }
- };
-
- resource 'inaa' ( 9003 ) {
- format2{
- suspendBusyCursors, // how to handle cursor during atom
- actBefore, // when to run action atom
- dontActOnRemove, // run action atom on removal
- actOnInstall, // run action atom on install
- 'infn', // resource type of code resource
- 9003, // resource ID of code resource
- 3, // refcon ID
-
- // NOTE: Enter zero for this value to use the installer's heap,
- // or enter size in bytes to have this action atom use it's own heap.
- // All earlier action atom formats use the installer's heap.
- // IMPORTANT: enter zero for this field unless you have a specific
- // reason for your action atom to use memory from it's own heap.
- 0, // requested memory in bytes
-
-
- "progress bar action atom" // description of atom
- }
- };